<?php namespace app\admin\controller;

class Tag extends Common {
	protected $db;
	public function __init()
	{
		$this->db = new \system\model\Tag();
	}
    //动作
    public function index(){
    //此处书写代码...
		$data = Db::table('tag')->get();
		//p($data);
		View::with('data',$data);
		return view();
    }
    /**
	 * 添加标签
	 */
    public function store()
	{
		if(IS_POST)
		{
			$res = $this->db->store();
			if($res['valid']){
				//添加成功
				message($res['message'],u('index'),'success');
			}
			message($res['message'],'back','error');

		}
		return view();
	}
	/**
	 * 编辑
	 */
	public function edit()
	{
		return view();
	}
}
